package com.aft.terra.modules.game.model;

import java.util.List;

import com.aft.terra.modules.game.model.base.BaseLucky;
import com.jfinal.plugin.activerecord.Db;

public class Lucky extends BaseLucky<Lucky> {

	private static final long serialVersionUID = 1L;

	public static final Lucky dao = new Lucky();
	
	/**
	 * 查询所有集合
	 * @return
	 */
	public List<Lucky> findByLucky() {
		String sql ="select * from t_lucky";
		return find(sql);
	}
	
	/**
	 * 更新库存
	 * @param prizeId
	 */
	public void updateIdOnStack(Long luckyId) {
		String sql ="UPDATE t_lucky SET lucky_sum = lucky_sum - 1 where  id = ? ";
		Db.update(sql,luckyId);
	}
}
